<?php
namespace Weixin\Service;
use Think\Model;
class PayNotifyService extends  Model{
	//更新订单
	public function update_order($data){
		$m = M('YgclOrder');
		$where['ddbh'] = $data['out_trade_no'];
		//更新订单的状态
		$orderdate['status'] = 1;
		$orderdate['wxddh'] = $data['$transaction_id'];
		$m ->where($where)->save($orderdate);
		
		$uid = $m ->where($where)->getField('uid');
		M('Users')->where(array('uid'=>$uid))->setInc('score',ceil($data['total_fee']));
	}
}